package estacion.dominio;

import java.util.Vector;


import estacion.persistencia.FPTren;


public class Tren extends Vehiculo{

	private Linea linea;
	
	public Tren(){
		super();
		linea=new Linea();
	}
	
	
	public Linea getLinea() {
		return linea;
	}


	public void setLinea(Linea codigo_linea) {
		linea = codigo_linea;
	}

	@Override
	public Vehiculo consultarVehiculo(String codigo) throws Exception{
		return FPTren.consultTren(codigo);

	}
	
	public Vehiculo consultarVehiculoLinea(int codigo_linea) throws Exception{
		return FPTren.consultTrenLinea(codigo_linea);
	}
	
	@Override
	public void insertarVehiculo() throws Exception {
		 FPTren.insertTren(this);
		
	}

	@Override
	public void eliminarVehiculo(String codigo) throws Exception {
		FPTren.deleteTren(codigo);
		
	}

	@Override
	public void modificarVehiculo() throws Exception {
		FPTren.modificarTren(this, this.Codigo_vehiculo);
		
	}

	@Override
	public Vector<Vehiculo> getVehiculos() throws Exception {
		return FPTren.getTrenes();
	}


}
